/* Responsive styles: final owner for phone portrait/landscape overrides. Load this file last. */

@media (max-width: 700px) {
  html,
  body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  html body .topbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    height: auto !important;
    min-height: 188px !important;
    max-height: none !important;
    box-sizing: border-box !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 0 8px 8px !important;
    transform: translateY(-16px) !important;
    overflow: visible !important;
  }

  html body .topbar .brand-wrap {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  html body .topbar .brand-logo {
    height: 116px !important;
    max-width: 78vw !important;
  }

  html body .topbar .market-strip,
  html body .topbar .tabs {
    transform: none !important;
    gap: 6px !important;
  }

  html body .topbar .tabs {
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    row-gap: 6px !important;
    overflow: visible !important;
  }

  html body .topbar .market-strip {
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    row-gap: 6px !important;
  }

  html body .topbar .market-switch {
    gap: 5px !important;
  }

  html body .topbar .brand-exchange,
  html body .topbar .market-btn,
  html body .topbar .tab {
    min-height: 22px !important;
    padding: 0 7px !important;
    font-size: 8.5px !important;
  }

  html body .topbar .tiger-header-open {
    display: none !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    font-size: 8px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden !important;
  }

  html body .topbar .tiger-header-open-text {
    display: none !important;
  }

  html body .topbar .tiger-header-open-logo {
    width: 13px !important;
    height: 13px !important;
    flex-basis: 13px !important;
  }

  html body .app {
    margin-top: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }

  html body #view-chart {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }

  html body #chart-controls,
  html body #chart-controls.panel.controls,
  html body .chart-controls {
    box-sizing: border-box !important;
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    margin: 8px 14px 10px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    transform: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
    row-gap: 7px !important;
    overflow: visible !important;
  }

  html body #chart-sr-settings-slot,
  html body #chart-gap-average-settings-slot,
  html body #chart-gap-forecast-settings-slot,
  html body #chart-trades-settings-slot {
    display: inline-flex !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body #chart-sr-settings-slot,
  html body #chart-trades-settings-slot {
    display: flex !important;
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
  }

  html body #chart-sr-settings-slot .sr-settings,
  html body #chart-trades-settings-slot .chart-trades-toggle {
    max-width: 100% !important;
  }

  html body .chart-controls .sr-settings {
    display: inline-flex !important;
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
  }

  html body .chart-trades-toggle {
    max-width: 100% !important;
    white-space: nowrap !important;
  }

  html body #chart-root,
  html body #chart-root.chart-area,
  html body .chart-area,
  html body .gap-forecast-mobile-card-slot,
  html body #view-chart .tiger-page-banner {
    box-sizing: border-box !important;
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    min-width: 0 !important;
    margin-left: 14px !important;
    margin-right: 14px !important;
    transform: none !important;
  }

  html body #chart-root,
  html body #chart-root.chart-area,
  html body .chart-area {
    overflow: hidden !important;
  }

  html body #chart-root.chart-area > .chart-metrics-overlay,
  html body .chart-area > .chart-metrics-overlay,
  html body #chart-root.chart-area > .gap-forecast-card,
  html body .chart-area > .gap-forecast-card {
    display: none !important;
  }

  html body .chart-status-overlay {
    left: 12px !important;
    max-width: calc(100% - 24px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body .gap-forecast-mobile-card-slot {
    margin-top: 10px !important;
    margin-bottom: 14px !important;
  }

  html body .gap-forecast-mobile-card-slot .gap-forecast-card {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body .gap-forecast-mobile-card-slot .gap-forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  html body .gap-forecast-title,
  html body .gap-forecast-grid,
  html body .gap-forecast-cell,
  html body .gap-forecast-label,
  html body .gap-forecast-value,
  html body .gap-forecast-factors,
  html body .gap-forecast-warn {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body .gap-forecast-factors,
  html body .gap-forecast-warn {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html body .gap-forecast-panel .gap-forecast-actions {
    position: sticky !important;
    bottom: -1px !important;
    z-index: 3 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin: 8px 0 0 !important;
    padding: 10px 0 0 !important;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0), rgba(2, 6, 23, 0.96) 34%, rgba(2, 6, 23, 0.98)) !important;
  }

  html body .gap-forecast-panel .gap-forecast-action {
    min-height: 34px !important;
    padding: 8px 12px !important;
  }

  html body #view-chart .tiger-page-banner {
    padding: 14px !important;
    overflow: hidden !important;
  }

  html body #view-chart .tiger-page-banner-copy {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  html body #view-chart .tiger-page-banner-copy strong,
  html body #view-chart .tiger-page-banner-copy span {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body #view-chart .tiger-page-banner-cta {
    width: 100% !important;
    max-width: 100% !important;
  }

  html body:has(#view-chart:not([hidden])) .tg-float {
    display: none !important;
  }

  html body .chart-controls #chart-symbol {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
  }

  html body .chart-controls label:has(#chart-limit) {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
}

@media (max-height: 500px) and (max-width: 960px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  html body .topbar {
    display: grid !important;
    grid-template-columns: minmax(190px, 0.8fr) auto minmax(0, 1.2fr) !important;
    align-items: center !important;
    gap: 5px !important;
    box-sizing: border-box !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 76px !important;
    min-height: 76px !important;
    max-height: 76px !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding: 2px 6px !important;
    transform: none !important;
    overflow: hidden !important;
  }

  html body .topbar .brand-wrap,
  html body .topbar a.brand.brand-with-logo,
  html body .topbar .brand.brand-with-logo {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  html body .topbar .brand-logo {
    height: 68px !important;
    width: auto !important;
    max-width: min(36vw, 320px) !important;
    object-fit: contain !important;
  }

  html body .topbar .market-strip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    transform: none !important;
  }

  html body .topbar .market-switch {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  html body .topbar .tabs {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    transform: none !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  html body .topbar .tabs::-webkit-scrollbar {
    display: none !important;
  }

  html body .topbar .brand-exchange,
  html body .topbar .market-btn,
  html body .topbar .tab {
    flex: 0 0 auto !important;
    min-height: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    font-size: 7px !important;
    line-height: 18px !important;
    white-space: nowrap !important;
  }

  html body .topbar .tiger-header-open {
    flex: 0 0 auto !important;
    min-width: 92px !important;
    max-width: 104px !important;
    min-height: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    gap: 3px !important;
    font-size: 7px !important;
    line-height: 18px !important;
    overflow: hidden !important;
  }

  html body .topbar .tiger-header-open-logo {
    width: 10px !important;
    height: 10px !important;
    flex: 0 0 10px !important;
  }

  html body .topbar .tiger-header-open-text {
    min-width: 0 !important;
    max-width: 82px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body .app {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin-top: 0 !important;
    padding: 0 6px 10px !important;
    overflow-x: hidden !important;
  }

  html body #view-chart > h1 {
    display: none !important;
  }

  html body #chart-controls,
  html body #chart-controls.panel.controls,
  html body .chart-controls {
    box-sizing: border-box !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    min-height: 0 !important;
    max-height: 68px !important;
    margin: 0 12px 6px !important;
    padding: 4px 6px !important;
    gap: 4px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
    border-radius: 8px !important;
  }

  html body #chart-sr-settings-slot,
  html body #chart-gap-average-settings-slot,
  html body #chart-gap-forecast-settings-slot,
  html body #chart-trades-settings-slot {
    display: inline-flex !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body .chart-trades-toggle {
    max-width: 100% !important;
    white-space: nowrap !important;
  }

  html body .chart-controls .chart-select,
  html body .chart-controls .chart-input,
  html body .chart-controls select,
  html body .chart-controls input[type="text"],
  html body .chart-controls input[type="number"],
  html body .chart-controls button,
  html body .chart-controls .btn {
    height: 16px !important;
    min-height: 16px !important;
    padding: 0 5px !important;
    font-size: 8px !important;
    line-height: 16px !important;
  }

  html body .chart-controls label,
  html body .chart-controls .chart-toggle,
  html body .chart-controls .chart-toggle span {
    font-size: 8px !important;
    line-height: 1.05 !important;
  }

  html body .chart-controls #chart-symbol {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
  }

  html body .chart-controls #chart-limit {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
  }

  html body .chart-controls label:has(#chart-limit) {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: 230px !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }

  html body #chart-root,
  html body #chart-root.chart-area,
  html body .chart-area {
    box-sizing: border-box !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    height: max(230px, calc(100dvh - 150px)) !important;
    min-height: 230px !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
    overflow: hidden !important;
  }

  html body #chart-root.chart-area > .chart-metrics-overlay,
  html body .chart-area > .chart-metrics-overlay,
  html body #chart-root.chart-area > .gap-forecast-card,
  html body .chart-area > .gap-forecast-card {
    display: none !important;
  }

  html body .gap-forecast-mobile-card-slot {
    box-sizing: border-box !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 0 !important;
    margin: 8px 12px 12px !important;
    transform: none !important;
  }

  html body .gap-forecast-mobile-card-slot .gap-forecast-card {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 11px 13px !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body .gap-forecast-panel .gap-forecast-actions {
    position: sticky !important;
    bottom: -1px !important;
    z-index: 3 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin: 8px 0 0 !important;
    padding: 10px 0 0 !important;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0), rgba(2, 6, 23, 0.96) 34%, rgba(2, 6, 23, 0.98)) !important;
  }

  html body .gap-forecast-panel .gap-forecast-action {
    min-height: 32px !important;
    padding: 7px 11px !important;
  }

  html body .chart-metrics-overlay {
    top: 18px !important;
    left: 8px !important;
    width: 118px !important;
    max-height: 154px !important;
  }

  html body .chart-metrics-overlay .chart-metrics-card {
    font-size: 8px !important;
    line-height: 1.05 !important;
  }

  html body .chart-metrics-overlay .metrics-card-title {
    font-size: 9px !important;
  }

  html body .chart-status-overlay {
    top: 6px !important;
    left: 8px !important;
    font-size: 7px !important;
  }

  html body .chart-overlay-controls {
    top: 8px !important;
    right: 8px !important;
    gap: 5px !important;
  }

  html body .chart-overlay-controls .btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
  }

  html body #chart-root.chart-area > .chart-bottom-nav,
  html body .chart-area > .chart-bottom-nav {
    bottom: 10px !important;
  }

  html body .footer,
  html body #view-chart .tiger-page-banner {
    display: none !important;
  }
}
